require(["global"], function(global){
	var vendor =  global.assets+ "/vendor/";
	require.config({
		baseUrl: global.assets+"/js",
		waitSeconds: 2000,
		paths : {
			"jquery" : vendor+"/jquery/jquery-1.11.0.min",
			"jquery-1.10.2" : vendor+"/jquery/jquery-1.10.2",
			"bootstrap" : vendor+"/bootstrap/3.1.1/js/bootstrap",
			"jquery.spinner" : vendor+"/jquery-spinner/0.1.5/js/jquery.spinner",
			"jquery.pnotify" : vendor+"/jquery-pnotify/1.2.2/js/jquery.pnotify.min",
			"jquery-bridget/jquery.bridget": vendor+"/masonry/masonry.pkgd",
			"holder" : vendor+"/holder/holder-2.3.1",
			"imagesloaded" : vendor+"/imagesloaded/imagesloaded.pkgd",
			"jquery.infinitescroll" : vendor+"/infinite-scroll/jquery.infinitescroll",
			"masonry" : vendor+"/masonry/masonry.pkgd",
			"modernizr" : vendor+"/modernizr/modernizr-2.7.1",
			"requirejs/text" : vendor+"/requirejs/plugins/text",
			"requirejs/i18n" : vendor+"/requirejs/plugins/i18n",
			"requirejs/domready" : vendor+"/requirejs/plugins/domReady",
			"requirejs/cs" : vendor+"/requirejs/plugins/cs",
			"datatables" : vendor+"/datatables/js/jquery.dataTables.min",
			"datatables2" : vendor+"/datatables/js/jquery.dataTables",
			"columnfilter": vendor+"/datatables/js/ColumnFilter",
			"fixedcolumns" : vendor + "/dataTables.fixedColumns/js/dataTables.fixedColumns",
			"jquery.migrate" : vendor + "/jquery.migrate/jquery.migrate",
			"datatables-language":"module/datatables-language",
			"jquery.sparkline"  : vendor + "/jquery.sparkline/jquery.sparkline.min",
			"jquery-template" : vendor +"jquery-template/jquery.loadTemplate-1.4.4.min",
			"backbone" : vendor+ "backbone/backbone-min",
			"underscore" : vendor + "underscore/underscore",
			"emitter" : vendor + "emitter/emitter",
			
			"pixeladmin": vendor+"/pixel-admin/js/pixel-admin",
        	"codemirror" : vendor + "lib/codemirror",
	        
	        // External plugins
	        "jquery.vague" :vendor+    "lib/jquery.vague-0.0.4",
	        "select2" :vendor+   "lib/select2-4.0.1/select2.min",

	         // ------------jQuery UI start-------------
	        "jquery.ui" : vendor+"jquery-ui/1.10.4/js/jquery-ui.min",
	        "jquery.ui.core" : vendor + "jquery-ui/1.10.4/jquery.ui.core",
	        "jquery.ui.widget"  : vendor + "jquery-ui/1.10.4/jquery.ui.widget",
	        "jquery.ui.mouse"  : vendor +     "jquery-ui/1.10.4/jquery.ui.mouse",
	        "jquery.ui.position"  : vendor +     "jquery-ui/1.10.4/jquery.ui.position",
	        "jquery.ui.sortable"  : vendor +     "jquery-ui/1.10.4/jquery.ui.sortable",
	        "jquery.ui.slider"  : vendor +     "jquery-ui/1.10.4/jquery.ui.slider",
	        "jquery.ui.accordion"  : vendor +    "jquery-ui/1.10.4/jquery.ui.accordion",
	        "jquery.ui.menu"  : vendor +    "jquery-ui/1.10.4/jquery.ui.menu",
	        "jquery.ui.autocomplete"  : vendor +     "jquery-ui/1.10.4/jquery.ui.autocomplete",
	        "jquery.ui.spinner"  : vendor +    "jquery-ui/1.10.4/jquery.ui.spinner",
	        "jquery.ui.progressbar"  : vendor +     "jquery-ui/1.10.4/jquery.ui.progressbar",
	        "jquery.ui.tabs"  : vendor +    "jquery-ui/1.10.4/jquery.ui.tabs",     
	        "pixel-slimscroll"  : vendor +     "lib/pixel-slimscroll", // Slimscroll, optimized for the main menu dropdowns / Navbar collapse
	         // ------------jQuery UI end-------------

           
            // Plugins
         	"bootstrap-datepicker"  : vendor +    "bootstrap-datepicker/1.3.0/bootstrap-datepicker",
         	"bootstrap-datepicker.zh-CN" : vendor +    "bootstrap-datepicker/1.3.0/locales/bootstrap-datepicker.zh-CN",
         	"bootstrap-timepicker"  : vendor +   "bootstrap-timepicker/0.2.5/js/bootstrap-timepicker",
        	"bootstrap-datetimepicker.zh-CN"  : vendor + "bootstrap-datetimepicker/2.0/js/locales/bootstrap-datetimepicker.zh-CN",
        	"bootstrap-datetimepicker"  : vendor + "bootstrap-datetimepicker/2.0/js/bootstrap-datetimepicker.min",
            
        	//------------bootstrap-fileinput start----------------------------
        	"bootstrap-fileinput_zh"  : vendor + "bootstrap-fileinput/4.3.5/js/locales/zh",
        	"bootstrap-fileinput"  : vendor + "bootstrap-fileinput/4.3.5/js/fileinput",
        	//------------bootstrap-fileinput end----------------------------
        	
			// -----------jquery-fileupload start------------
			"jquery.iframe-transport" : vendor+"/jquery-fileupload/5.42.3/js/jquery.iframe-transport",
			"jquery-fileupload" : vendor+"/jquery-fileupload/5.42.3/js/jquery.fileupload",
			"jquery.fileupload-process" : vendor+"/jquery-fileupload/5.42.3/js/jquery.fileupload-process",
			"jquery.fileupload-image" : vendor+"/jquery-fileupload/5.42.3/js/jquery.fileupload-image",
			"jquery.fileupload-audio" : vendor+"/jquery-fileupload/5.42.3/js/jquery.fileupload-audio",
			"jquery.fileupload-video" : vendor+"/jquery-fileupload/5.42.3/js/jquery.fileupload-video",
			"jquery.fileupload-validate" : vendor+"/jquery-fileupload/5.42.3/js/jquery.fileupload-validate",
			"jquery.fileupload-ui" : vendor+"/jquery-fileupload/5.42.3/js/jquery.fileupload-ui",
			// -----------jquery-fileupload end------------

			// -----------------------image plugs start------------------------
        	"viewer" : vendor + "/jquery-viewer/js/viewer",

			// -----------------------image plugs start------------------------
			
        	
          	"bootstrap-tabdrop"  : vendor +   "lib/bootstrap-tabdrop",
          	"jquery.minicolors"  : vendor +   "lib/jquery.minicolors-2.1.1",
          	"jquery.maskedinput"  : vendor +   "lib/jquery.maskedinput-1.3.1",
          	"jquery.autosize"  : vendor +   "lib/jquery.autosize-1.18.4",
          	"bootbox.min"  : vendor +  "lib/bootbox.min-4.2.0",
          	"jquery.growl"  : vendor +  "lib/jquery.growl-1.1.5",
          	"jquery.knob"  : vendor +   "lib/jquery.knob-1.2.7",
          	"jquery.sparkline"  : vendor +   "lib/jquery.sparkline-2.1.2",
          	"jquery.easypiechart"  : vendor +   "lib/jquery.easypiechart-2.1.5",
           	"jquery.slimscroll"  : vendor +  "lib/jquery.slimscroll-1.3.2",
            // {
           	"moment"  : vendor + "lib/moment-2.5.1",
           	"bootstrap-datepaginator"  : vendor +    "lib/bootstrap-datepaginator-1.1.0",
            // }
            // {
          	"bootstrap-editable"  : vendor +     "bootstrap-editable/1.5.1/bootstrap-editable",
          	"bootstrap-editable-address"  : vendor +    "bootstrap-editable/1.5.1/inputs-ext/address/address",
          	"bootstrap-editable-typeahead"  : vendor +    "bootstrap-editable/1.5.1/inputs-ext/typeaheadjs/lib/typeahead",
           	"bootstrap-editable-typeaheadjs"  : vendor +    "bootstrap-editable/1.5.1/inputs-ext/typeaheadjs/typeaheadjs",
           	
            // }
            // {
			"jquery.validate" : vendor+"/jquery-validation/1.11.1/js/jquery.validate",
           	"jquery.validate-additional-methods"  : vendor +   "jquery-validation/1.11.1/js/additional-methods",
            // }
            // {
           	"jquery.datatables.bootstrap3"  : vendor +  "jquery-datatables/1.10.0/js/datatables.bootstrap3",
            // }
            // {
          	"dropzone-amd-module"  : vendor +     "lib/dropzone-amd-module-3.8.4",
          	"dropzone"  : vendor +    "lib/dropzone-3.8.4",
            // }
            // {
           	"summernote"  : vendor +    "lib/summernote-0.5.1/summernote",
            // }
            // {
           	"markdown"  : vendor +    "bootstrap-markdown/2.2.1/js/markdown",
           	"to-markdown"  : vendor +   "bootstrap-markdown/2.2.1/js/to-markdown",
           	"bootstrap-markdown"  : vendor +   "bootstrap-markdown/2.2.1/js/bootstrap-markdown",
            // }
            // {
            "raphael"  : vendor +   "lib/raphael-2.1.2.min",
            "morris"  : vendor +   "lib/morris-0.5.0",
            // }
            // {
           	"jquery.flot"  : vendor +    "jquery.flot/0.8.2/js/jquery.flot",
           	"jquery.flot.pie"  : vendor +    "jquery.flot/0.8.2/js/jquery.flot.pie",
           	"jquery-tooltipster" : vendor +  "jquery-tooltipster/js/jquery.tooltipster",
        	"ztree"  : vendor +    "jquery.ztree/3.5.18/js/jquery.ztree.all-3.5",

        	// Touch devices
	        "fastclick":   vendor+ "lib/fastclick-0.6.11",
	        "jquery.event.move" : vendor + "lib/jquery.event.move-1.3.6",
	        "jquery.event.swipe"  : vendor +     "lib/jquery.event.swipe-0.5",
        	
			"jweixin" : ["https://res.wx.qq.com/open/js/jweixin-1.0.0", vendor + "tencent/weixin/js/jweixin-1.0.0"],
           	"jquery-weui" : vendor +  "jquery-weui/V0.8.2/js/jquery-weui.min",
			"jquery-weui.swiper" : vendor + "jquery-weui/V0.8.2/js/swiper.min",
           	"jquery-weui.router" : vendor +  "jquery-weui/V0.8.0/js/router.min",
           	"jquery-weui.zepto" : vendor +  "jquery-weui/V0.8.2/js/zepto.min",
           	"jquery-weui.city-picker" : vendor +  "jquery-weui/V0.8.2/js/city-picker.min",

           	"jquery.cookie"  : vendor +  "jquery.cookie/1.4.1/jquery.cookie",
        	
        	"prefixfree" : vendor + "prefixfree.min",
        	"detectmobilebrowser" : vendor + "lib/detectmobilebrowser",
			//--------------end
		},
		// Remember: only use shim config for non-AMD scripts,
		// scripts that do not already call define(). The shim
		// config will not work correctly if used on AMD scripts,
		// in particular, the exports and init config will not
		// be triggered, and the deps config will be confusing
		// for those cases.
		shim : {
			"user_manager":{
				deps : ["jquery"]
			},
			"jquery-fileupload":{
				deps : ["jquery"]
			},
			"datatables-language":{
				deps : ["jquery"]
			},
			"bootstrap-datepicker":{
              	deps : ["jquery"]
            },
			"datepicker-CN":{
				deps : ["jquery","bootstrap-datepicker"]
			},
            "bootstrap-timepicker":{
              	deps : ["jquery"]
            },
            "bootstrap-datetimepicker":{
              	deps : ["jquery"]
            },
            "bootstrap-datetimepicker.zh-CN":{
              	deps : ["jquery", "bootstrap-datetimepicker"]
            },
            "bootstrap-fileinput" : {
            	deps : ["jquery"]
			},
            "bootstrap-fileinput_zh" : {
            	deps : ["jquery", "bootstrap-fileinput"]
			},
			"bootstrap-datepaginator":{
              	deps : ["jquery","moment"]
          	},
          	"jquery.ui.position":{
          		deps : ["jquery"]
          	},
          	"pixel-slimscroll":{
          		deps : ["jquery"]
          	},
          	"jquery.minicolors":{
          		deps : ["jquery"]
          	},
          	"jquery.maskedinput":{
          		deps : ["jquery"]
          	},
          	"jquery.autosize":{
          		deps : ["jquery"]
          	},
          	"jquery.growl":{
          		deps : ["jquery"]
          	},
          	"jquery.slimscroll":{
          		deps : ["jquery"]
          	},
          	"bootstrap-markdown":{
          		deps : ["jquery"]
          	},
          	"morris":{
          		deps : ["jquery"]
          	},
          	"jquery.flot":{
          		deps : ["jquery"]
          	},
			"modernizr": {
				// Once loaded, use the global "Holder" as the
				// module value.
				exports: "Modernizr"
			},
			"holder": {
				// Once loaded, use the global "Holder" as the
				// module value.
				exports: "Holder"
			},
			"bootstrap": {
				// These script dependencies should be loaded before loading
				// bootstrap modual
				deps : [ "jquery"]
			},
			"jquery.ui.spinner":{
				deps : [ "jquery.ui.widget"]
			},
			"jquery.ui.autocomplete":{
				deps : [ "jquery.ui.widget"]
			},
			"jquery.ui.accordion":{
				deps : [ "jquery.ui.widget"]
			},
			"jquery.ui.progressbar":{
				deps : [ "jquery.ui.widget"]
			},
			"jquery.ui.tabs":{
				deps : [ "jquery.ui.widget"]
			},
			"jquery.ui.menu":{
				deps : [ "jquery.ui.widget"]
			},
			"jquery.ui.sortable":{
				deps : [ "jquery.ui.widget","jquery.ui.core"]
			},
			"jquery.ui.slider":{
				deps : [ "jquery.ui.widget","jquery.ui.mouse"]
			},
			"jquery.ui.widget":{
				deps : ["jquery","jquery.ui.core"]
			},
			"jquery.ui.mouse":{
				deps : ["jquery","jquery.ui.widget"]
			},
			"jquery.ui.core":{
              		deps : ["jquery"]
              },
              "jquery.validate":{
              		deps : ["jquery"]
              },
              "jquery.validate-additional-methods":{
              	deps : ["jquery","jquery.validate"]
              },
              "bootstrap-tabdrop":{
					deps : ["bootstrap","jquery"]
              },
              "datatables2":{
            		deps : ["jquery"]
              },
              "datatables":{
              		deps : ["jquery"]
              },
              "jquery.datatables.bootstrap3":{
              	deps : ["jquery","bootstrap","datatables"]
              },
              "jquery.flot.pie":{
				deps : ["bootstrap","jquery"]
              },
              "jquery.knob":{
              	deps : ["jquery"]
              },
              "jquery.vague":{
              	deps : ["jquery"]
              },
              "select2":{
              	deps : ["jquery"]
              },
			"moment":{
				deps : [ "jquery"]
			},
		 	"pixeladmin": {
			 	deps : [  
			 		"jquery",
			 		"bootstrap",
			 		"bootstrap-datepicker",
			 		"bootstrap-timepicker",
               		"bootstrap-datepaginator",
               		"bootstrap-tabdrop",
               		"jquery.validate",
               		"jquery.knob",
               		"jquery.sparkline",
               		"fastclick",
					//"jquery.event.move",
					//"jquery.event.swipe",
					//Externalplugins",
					"jquery.vague",
					"select2",
					//jQueryUI",
					"jquery.ui.core",
					"jquery.ui.widget",
					"jquery.ui.mouse",
					"jquery.ui.position",
					"jquery.ui.sortable",
					"jquery.ui.slider",
					"jquery.ui.accordion",
					"jquery.ui.menu",
					"jquery.ui.autocomplete",
					"jquery.ui.spinner",
					"jquery.ui.progressbar",
					"jquery.ui.tabs",
					"pixel-slimscroll",
				//Plugins",
					"jquery.minicolors",
					"jquery.maskedinput",
					"jquery.autosize",
					"bootbox.min",
					"jquery.growl",
					"jquery.knob",
					"jquery.sparkline",
					"jquery.easypiechart",
					"jquery.slimscroll",
				//{",
					"moment",
				//}",
				//{",
				//	"bootstrap-editable",
					//"bootstrap-editable-address",
					//"bootstrap-editable-typeahead",
					//"bootstrap-editable-typeaheadjs",
				//}",
				//{",
					"jquery.validate",
					"jquery.validate-additional-methods",
				//}",
				//{",
					//"jquery.datatables",
					//"datatables",
					//"jquery.datatables.bootstrap3",
				//}",
				//{",
					"dropzone-amd-module",
					//"dropzone",
				//}",
				//{",
					"summernote",
				//}",
				//{",
					"markdown",
					"to-markdown",
					"bootstrap-markdown",
				//}",
				//{",
				"raphael",
				"morris",
				//}",
				//{",
					//"jquery.flot",
					//"jquery.flot.pie"
               	]
			 },
			"jquery.ui": {
				deps : [ "jquery" ]
			},
			"jquery.validate": {
				deps : [ "jquery" ]
			},
			"jquery.spinner" : {
				deps : [ "jquery" ]
			},
			"jquery.pnotify" : {
				deps : [ "jquery" ]
			},
			"jquery.infinitescroll" : {
				deps : [ "jquery" ]
			},
			"plugins": {
				deps : [ "jquery.pnotify" ]
			},
			"jquery.migrate":{
	            deps : ["jquery"]
	        },
			"fixedcolumns":{
                deps : ["jquery","datatables", "jquery.migrate"]
            },
	        "columnfilter":{
                deps : ["jquery","datatables"]
            },
            "jquery-template":{
            	deps : ["jquery"]
            },
            "backbone":{
            	deps:["jquery","underscore"]
            },
            "underscore":{
            	deps:["jquery"]
            },
            "ztree":{
            	deps : ["jquery"]
            },
            "jquery-tooltipster":{
            	deps : ["jquery"]
            },
            "jquery-weui": {
				deps : [ "jquery"]
			},
            "jquery.city-picker": {
				deps : [ "jquery","jquery-weui"]
			},
            "bootstrapValidator": {
				deps : [ "jquery","bootstrap"]
			}

		}
	});
});